﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Control_LoginView : System.Web.UI.UserControl
{
    AdminUser adminUser = new AdminUser();
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!adminUser.IsLogin())
        {

            HttpContext.Current.Response.Redirect("~/Default.aspx");

        }
        else
        {
            username.Text = adminUser.Admin.Username;
        }
        
    }
    protected void lb_logout_Click(object sender, EventArgs e)
    {
        adminUser.Logout();
        HttpContext.Current.Response.Redirect("~/Admin/Default.aspx");

    }
}
